home *** CD-ROM | disk | FTP | other *** search
- unit IEBrowsU;
-
- {$ifdef Windows}
- 'This is for Win32 compilers only'
- {$endif}
- {$ifdef Ver90} { Delphi 2.0x }
- {$define DelphiLessThan3}
- {$define DelphiLessThan4}
- {$endif}
- {$ifdef Ver93} { C++ Builder 1.0x }
- {$define DelphiLessThan3}
- {$define DelphiLessThan4}
- {$endif}
- {$ifdef Ver100} { Delphi 3.0x }
- {$define DelphiLessThan4}
- {$endif}
- {$ifdef Ver110} { C++ Builder 3.0x }
- {$define DelphiLessThan4}
- {$endif}
-
- interface
-
- uses
- {$ifdef DelphiLessThan3}
- ShDocVw,
- {$else}
- SHDocVw_TLB,
- {$endif}
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ExtCtrls;
-
- type
- TForm1 = class(TForm)
- btnAbout: TButton;
- btnEasterEgg: TButton;
- Panel1: TPanel;
- btnWin98: TButton;
- edtURL: TEdit;
- Label1: TLabel;
- btnBrowse: TButton;
- procedure btnBrowseClick(Sender: TObject);
- procedure btnAboutClick(Sender: TObject);
- procedure btnEasterEggClick(Sender: TObject);
- procedure btnWin98Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- {$ifdef DelphiLessThan4}
- var
- EmptyParam: {$ifdef DelphiLessThan3}Variant{$else}OleVariant{$endif};
- {$endif}
-
- const
- WB: TWebBrowser = nil;
-
- procedure TForm1.btnBrowseClick(Sender: TObject);
- begin
- if not Assigned(WB) then
- begin
- WB := TWebBrowser.Create(Self);
- TControl(WB).Parent := Panel1;
- WB.Align := alClient;
- end;
- WB.Navigate(edtURL.Text, EmptyParam, EmptyParam, EmptyParam, EmptyParam)
- end;
-
- procedure TForm1.btnAboutClick(Sender: TObject);
- begin
- if not Assigned(WB) then
- begin
- WB := TWebBrowser.Create(Self);
- TControl(WB).Parent := Panel1;
- WB.Align := alClient;
- end;
- WB.Navigate('res://shdocvw.dll/about.dlg',
- EmptyParam, EmptyParam, EmptyParam, EmptyParam)
- end;
-
- procedure TForm1.btnEasterEggClick(Sender: TObject);
- var
- Target: {$ifdef DelphiLessThan3}Variant{$else}OleVariant{$endif};
- begin
- Target := 'TheWCEE';
- with TWebBrowser.Create(Self) do
- try
- Navigate('res://shdocvw.dll/wcee.htm',
- EmptyParam, Target, EmptyParam, EmptyParam)
- finally
- Free
- end;
- end;
-
- { Windows 98 Easter Egg Instructions
-
- Invoke the Date/Time Properties applet from Control Panel.
- This can be done by invoking Control Panel first, then
- locating the relevant icon and double-clicking it.
- You can also double-click the Clock in your task bar's
- system tray. Alternatively, run one of these command-lines:
-
- COMMAND DATE/TIME
- COMMAND TIMEDATE.CPL
-
- Click on the Time Zone tab
- The next bit relies on some geography knowledge.
- Hold down the Ctrl key and drag Memphis, Egypt and
- drop it on Memphis, Tennessee.
- Now hold down the Ctrl key and drag Memphis, Tennessee and
- drop it on Seattle, USA
-
- If you got the right locations, a window will appear with
- various pictures that come and go, and the credits list
- will scroll by.
-
- There is a soundtrack as well, so turn your speakers up.
-
- You can circumvent all this trickery by making a new
- shortcut on your Windows98 desktop. Make a shortcut with
- a command-line of:
-
- "C:\Windows\Application Data\Microsoft\Welcome\WelData.Exe" You_are_a_real_rascal
-
- Make sure you go back to the properties for this shortcut
- (right-click and choose properties) and set the Run: option
- to say Minimized.
-
- The soundtrack to this Easter Egg is the file
- C:\Windows\Application Data\Microsoft\Welcome\Welcom98.Wav }
- procedure TForm1.btnWin98Click(Sender: TObject);
- var
- WinDir: array[0..MAX_PATH-1] of Char;
- CmdLine: String;
- const
- RelPath = '\Application Data\Microsoft\Welcome\';
- AppName = 'WELDATA.EXE';
- AppParam = 'You_are_a_real_rascal';
- begin
- GetWindowsDirectory(WinDir, MAX_PATH);
- CmdLine := Format('"%s%s%s" %s', [WinDir, RelPath, AppName, AppParam]);
- WinExec(PChar(CmdLine), SW_SHOWMINNOACTIVE);
- end;
-
- {$ifdef DelphiLessThan4}
- initialization
- TVarData(EmptyParam).VType := varError;
- TVarData(EmptyParam).VError := DISP_E_PARAMNOTFOUND
- {$endif}
- end.
-